/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: FactoryLocationService
 * Author:   周宏硕
 * Date:     2018/10/30 11:51
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.htwx.service.Impl;


import com.htwx.dao.FactoryLocationDao;
import com.htwx.entity.FactoryLocation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 周宏硕
 * @create 2018/10/30
 * @since 1.0.0
 */

@Service("FactoryLocationService")
@Transactional
public class FactoryLocationService implements com.htwx.service.FactoryLocationService {

    @Autowired
    private FactoryLocationDao factoryLocationDao;

    @Override
    public List<FactoryLocation> getFactorylocationAll() {
        return factoryLocationDao.getFactorylocationAll();
    }

    @Override
    public List<FactoryLocation> findFactoryLocationBylocaitonId(String factorylocationId) {
        return factoryLocationDao.findFactoryLocationBylocaitonId(factorylocationId);
    }

    @Override
    public String insertFactoryLocation(FactoryLocation factoryLocation) {
        Integer result = factoryLocationDao.insertFactoryLocation(factoryLocation);
        String flag = "";
        if (result > 0) {
            flag = "ok";
        } else {
            flag = "no";
        }
        return flag;
    }

    @Override
    public Integer updateFactoryLocation(FactoryLocation factoryLocation) {
        return factoryLocationDao.updateFactoryLocation(factoryLocation);
    }

    @Override
    public Integer deleteFactoryLocation(Integer locationId) {
        return factoryLocationDao.deleteFactoryLocation(locationId);
    }
}
